<?php
require_once('custom/modules/Documents/SugarWidgets/SugarWidgetSubPanelTopCreateDocumentButton.php');
require_once('modules/edanz_Flags/SugarWidgets/SugarWidgetSubPanelTopCreateFlagButton.php');
require_once('modules/edanz_Feedback/SugarWidgets/SugarWidgetSubPanelTopButtonConstructFeedback.php');

$layout_defs['Tasks']['subpanel_setup']['documents'] = array(
	'order' => 300,
	'module' => 'Documents',
	'subpanel_name' => 'default',
	'sort_order' => 'desc',
	'sort_by' => 'id',
	'type' => 'collection',
	'title_key' => 'LBL_TASK_DOCUMENTS',
	'top_buttons' => array (
	//	array ('widget_class' => 'SubPanelTopButtonQuickCreate'),
		array ('widget_class' => 'SubPanelTopCreateDocumentButton'),
//		array ('widget_class' => 'SubPanelTopSelectButton'),
	),
	'collection_list' => array(	
		'documents' => array(
			'module' => 'Documents',
			'subpanel_name' => 'ForTasks',
			'get_subpanel_data' => 'function:get_document_query',
			'generate_select'=>true,
			'function_parameters' => array(
				'return_as_array'=>'true',
				'import_function_file' => 'custom/modules/Tasks/SiblingSubpanel.php',
				'task_id' => $_REQUEST['record'],
			),
		),	
	 ),	

);

$layout_defs['Tasks']['subpanel_setup']['flags'] = array(
	'order' => 500,
	'sort_order' => 'desc',
	'sort_by' => 'id',
	'title_key' => 'LBL_FLAGS_SUBPANEL_TITLE',
	'type' => 'collection',
	'subpanel_name' => 'flags',   //this values is not associated with a physical file.
	'module'=>'edanz_Flags',
//	'module'=>'edanz_Deliverables',
	'top_buttons' => array(
		array('widget_class' => 'SubPanelTopCreateFlagButton'),
		array ('widget_class' => 'SubPanelTopSelectButton'),
	),	
	'collection_list' => array(	
		'flags' => array(
			'module' => 'edanz_Flags',
			'subpanel_name' => 'ForTask',
			'get_subpanel_data' => 'function:get_flags_query',
			'generate_select'=>true,
			'function_parameters' => array(
				'return_as_array'=>'true',
				'import_function_file' => 'custom/modules/Tasks/SiblingSubpanel.php',
				'task_id' => $_REQUEST['record'],
			),
		),	
	 ),
);
//$layout_defs['Tasks']['subpanel_setup']['flags'] = array(
//                        'order' => 200,
//                        'module' => 'edanz_Flags',
//                        'get_subpanel_data' => 'flags',
//                        'sort_order' => 'desc',
//                        'sort_by' => 'date_entered',
//                        'subpanel_name' => 'default',
//                        'title_key' => 'LBL_FLAGS_SUBPANEL_TITLE',
//                        'top_buttons' => array(
//							array('widget_class' => 'SubPanelTopButtonQuickCreate'),
//							array('widget_class' => 'SubPanelTopSelectButton'),
//			//array('widget_class' => 'SubPanelTopSelectButton'),
//                        ),
//        );

$layout_defs["Tasks"]["subpanel_setup"]["fees"] = array (
		'order' => 400,
  		'module' => 'edanz_Fees',
  		'get_subpanel_data' => 'fees',
  		'subpanel_name' => 'default',
  		'sort_order' => 'asc',
  		'sort_by' => 'id',
  		'title_key' => 'LBL_FEES_SUBPANEL_TITLE',
  		'top_buttons' => 
  		array (
			array ('widget_class' => 'SubPanelTopButtonQuickCreate'),
  		),
	);
	$layout_defs["Tasks"]["subpanel_setup"]["edanz_tasks_edanz_authorpreferences"] = array (
		'order' => 200,
  		'module' => 'edanz_Authorpreferences',
  		'subpanel_name' => 'default',
  		'sort_order' => 'asc',
  		'sort_by' => 'id',
  		'type' => 'collection',
  		'title_key' => 'LBL_AUTHORPREFERENCES_SUBPANEL_TITLE',
  		'top_buttons' => 
  		array (
			array ('widget_class' => 'SubPanelTopButtonQuickCreate'),
			array ('widget_class' => 'SubPanelTopSelectButton',
				   'mode' => 'MultiSelect',
			),
  		),
  		'collection_list' => array(	
		'authorpreferences' => array(
			'module' => 'edanz_Authorpreferences',
			'subpanel_name' => 'ForTask',
			'get_subpanel_data' => 'function:get_authorpreferences_query',
			'generate_select'=>true,
			'function_parameters' => array(
				'return_as_array'=>'true',
				'import_function_file' => 'custom/modules/Tasks/SiblingSubpanel.php',
				'task_id' => $_REQUEST['record'],
			),
		),	
	 ),
	);
	$layout_defs["Tasks"]["subpanel_setup"]["edanz_tasks_edanz_communications"] = array (
		'order' => 100,
  		'module' => 'edanz_Communications',
  		'subpanel_name' => 'default',
  		'sort_order' => 'asc',
  		'sort_by' => 'id',
  		'type' => 'collection',
  		'title_key' => 'LBL_COMMUNICATION_SUBPANEL_TITLE',
  		'get_subpanel_data' => 'edanz_tasks_edanz_communications',
  		'top_buttons' => 
  		array (
			array ('widget_class' => 'SubPanelTopButtonQuickCreate'),
			array ('widget_class' => 'SubPanelTopSelectButton',
					'mode' => 'MultiSelect',
					),
  		),
  		'collection_list' => array(	
		'communications' => array(
			'module' => 'edanz_Communications',
			'subpanel_name' => 'ForTask',
			'get_subpanel_data' => 'function:get_communications_query',
			'generate_select'=>true,
			'function_parameters' => array(
				'return_as_array'=>'true',
				'import_function_file' => 'custom/modules/Tasks/SiblingSubpanel.php',
				'task_id' => $_REQUEST['record'],
			),
		),	
	 ),
	);
$layout_defs['Tasks']['subpanel_setup']['tasks'] = array(
	'order' => 700,
	'sort_order' => 'desc',
	'sort_by' => 'id',
	'title_key' => 'LBL_TASK_SUBPANEL_TITLE',
	'type' => 'collection',
	'subpanel_name' => 'ForTasks',   //this values is not associated with a physical file.
	'module'=>'Tasks',
	'top_buttons' => array(),	
	'collection_list' => array(	
		'tasks' => array(
			'module' => 'Tasks',
			'subpanel_name' => 'ForTasks',
			'get_subpanel_data' => 'function:get_task_query',
			'generate_select'=>true,
			'function_parameters' => array(
				'return_as_array'=>'true',
				'import_function_file' => 'custom/modules/Tasks/SiblingSubpanel.php',
				'task_id' => $_REQUEST['record'],
			),
		),	
	 ),
);

$layout_defs['Tasks']['subpanel_setup']['feedback'] = array(
	'order' => 600,
	'sort_order' => 'desc',
	'sort_by' => 'id',
	'title_key' => 'LBL_FEEDBACK_SUBPANEL_TITLE',
	'type' => 'collection',
	'subpanel_name' => 'feedback',   //this values is not associated with a physical file.
	'module'=>'edanz_Feedback',
	'top_buttons' => array(
		array('widget_class' => 'SubPanelTopButtonConstructFeedback'),
	),	
	'collection_list' => array(
		'feedback' => array(
			'module' => 'edanz_Feedback',
			'subpanel_name' => 'ForTask',
			'get_subpanel_data' => 'function:get_feedback_query',
			'generate_select'=>true,
			'function_parameters' => array(
				'return_as_array'=>'true',
				'import_function_file' => 'custom/modules/Tasks/SiblingSubpanel.php',
				'task_id' => $_REQUEST['record'],
			),
		),	
	 ),
);
?>
